package com.hou.shardingjdbc.service.impl;


import com.hou.shardingjdbc.dao.OrderDao;
import com.hou.shardingjdbc.domain.PO.Order;
import com.hou.shardingjdbc.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.google.common.base.Preconditions.checkNotNull;

@Slf4j
@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDao orderDao;

    @Override
    public void insertOrder(Order order) {
        orderDao.insertOrder(order);
    }

    @Override
    public List<Order> findByOpenid(String openid) {
        return orderDao.findByOpenid(openid);
    }

    @Override
    public Integer selectCountByOpenid(String openid) {
        return orderDao.selectCountByOpenid(openid);
    }
}
